#pragma once

#include <iostream>
#include <string>

class Task
{
public:
    Task()
    {}
    // 带参构造
    Task(int x, int y) : _x(x), _y(y)
    {}
    // 仿函数，直接使用()访问Excute函数
    void operator()()
    {
        Excute();
    }
    void Excute()
    {
        _result = _x + _y;
    }
    std::string debug()
    {
        std::string msg = std::to_string(_x) + "+" + std::to_string(_y) + "=?";
        return msg;
    }
    std::string result()
    {
        std::string msg = std::to_string(_x) + "+" + std::to_string(_y) + "=" + std::to_string(_result);
        return msg;
    }
private:
    int _x;
    int _y;
    int _result;
};